home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-09 | 4.0 KB | 135 lines | [TEXT/PJMM] |
- unit ExternalInterface;
- interface
-
- { Interface structure definition. This structure is for reference only; you should not }
- { modify any of its fields. It will also be most convenient for you to use the library }
- { routines (declared below) to call the functions in the callback block. }
-
- type
- ExternalCallbackBlock = record
- version: Integer;
-
- { the callback routines are abstracted away for greater convenience when used }
- { from Pascal. }
- callbacks: array[0..0] of ProcPtr;
- end;
- ExternalCallbackPtr = ^ExternalCallbackBlock;
-
- { This data type is used in the "OpenSeveral" call. }
- type
- ReplyList = array[0..255] of StandardFileReply;
- ReplyListPtr = ^ReplyList;
- ReplyListHandle = ^ReplyListPtr;
-
- { This data type is used by the "GetProjectList" call. }
- type
- ProjectEntry = record
- spec: FSSpec;
-
- treeID: SignedByte;
- found: Boolean;
-
- fType: OSType;
- fCrtr: OSType;
- end;
-
- ProjectEntryArray = array[0..255] of ProjectEntry;
- ProjectEntryArrayPtr = ^ProjectEntryArray;
- ProjectEntryArrayHandle = ^ProjectEntryArrayPtr;
-
- { This routine should be called as the FIRST THING in your external's main routine. }
- procedure PrepareCallbacks (callbacks: ExternalCallbackPtr);
-
- { Your "main" should be declared thus: }
- { PROCEDURE Main(callbacks : ExternalCallbackPtr; w:WindowPtr); }
-
- { External callback routines. }
-
- { Version 1 callbacks }
- function GetWindowContents (w: WindowPtr): Handle;
- procedure GetSelection (var selStart, selEnd, firstChar: LongInt);
- procedure SetSelection (selStart, selEnd, firstChar: LongInt);
- procedure GetDocInfo (w: WindowPtr;
- var fName: Str255;
- var vRefNum: Integer;
- var dirID: LongInt);
- function GetModDate (w: WindowPtr): LongInt;
- function CopyText: Handle;
- procedure PasteText (pasteText: Handle);
-
- { Version 2 callbacks }
- function GetLastLine: LongInt;
- function GetLineNumber (selection: LongInt): LongInt;
- function GetLineStart (selection: LongInt): LongInt;
- function GetLineEnd (selection: LongInt): LongInt;
- function GetLinePos (line: LongInt): LongInt;
-
- procedure InsertText (text: univ Ptr;
- len: LongInt);
- procedure DeleteText;
-
- procedure SetWindowContents (w: WindowPtr;
- h: Handle);
- procedure ContentsChanged (w: WindowPtr);
-
- function GetFiletext (vRefNum: Integer;
- dirID: LongInt;
- fName: Str255;
- var canDispose: Boolean): Handle;
-
- function GetFolder (prompt: Str255;
- var vRefNum: Integer;
- var dirID: LongInt): Boolean;
- function OpenSeveral (sort: Boolean;
- var fileCount: LongInt;
- var files: ReplyListHandle): Boolean;
-
- function CenterDialog (dialogID: Integer): DialogPtr;
- function StandardFilter (d: DialogPtr;
- var event: EventRecord;
- var item: Integer): Boolean;
- procedure FrameDialogItem (d: DialogPtr;
- item: Integer);
-
- function NewDocument: WindowPtr;
- function OpenDocument: WindowPtr;
-
- function AllocateMemory (size: LongInt;
- clear: Boolean): Handle;
- function FindPattern (text: univ Ptr;
- textLen: LongInt;
- textOffset: LongInt;
- pattern: univ Ptr;
- patLen: LongInt;
- caseSensitive: Boolean): LongInt;
- procedure ReportOSError (code: OSErr);
-
- procedure GetPreference (prefType: ResType;
- reqLen: Integer;
- buffer: univ Ptr;
- var actLen: Integer);
- procedure SetPreference (prefType: ResType;
- reqLen: Integer;
- buffer: univ Ptr;
- var actLen: Integer);
-
- procedure StartProgress (str: Str255;
- total: LongInt;
- cancelAllowed: Boolean);
- function DoProgress (done: LongInt): Boolean;
- procedure DoneProgress;
-
- { Version 3 callbacks. }
- function GetProjectList (spec: FSSpec;
- var projectKind: Integer;
- var count: Integer;
- var list: ProjectEntryArrayHandle): Boolean;
-
- function ProjectTextList (spec: FSSpec;
- var textList: Handle): Boolean;
-
- implementation
-
- { All routines declared above are defined in "ExternalInterface.Lib". }
-
- end.